package com.jjx.trainingapi.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.jjx.trainingapi.common.RT;
import com.jjx.trainingapi.entity.po.Section;
import com.jjx.trainingapi.entity.vo.SectionVo;
import com.jjx.trainingapi.service.SectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author LoveHuahua
 * @date 2022年05月23日 18:49
 * @description believe in yourself
 */
@RestController
@RequestMapping("/section")
public class SectionController {

    @Autowired
    SectionService sectionService;


    /**
     * 查询试题
     *
     * @param question
     * @return
     */
    @PostMapping("/sectionList")
    @SaCheckLogin
    public RT<List<SectionVo>> questionList(@RequestBody Section section) {
        return RT.ok(sectionService.questionList(section));
    }

}
